package org.example.utils;

import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.model.zhipu.ZhipuAiChatModel;

import java.time.Duration;

/**
 * @Author codeYang
 * @Date 2025/3/16 18:36
 * @Version 1.0
 */
public class ModelUtils {

    private static final String API_KEY_ZHIPU = "";


    public static ChatLanguageModel getZhipuAiModel() {
        return ZhipuAiChatModel.builder()
                .apiKey(ModelUtils.API_KEY_ZHIPU)
//                .model("GLM-4-Flash")
                .callTimeout(Duration.ofSeconds(10)) // 超时时间
                .connectTimeout(Duration.ofSeconds(10)) // 连接超时时间
                .writeTimeout(Duration.ofSeconds(10))
                .readTimeout(Duration.ofSeconds(10)) // 添加读取超时时间
                .build();
    }


}
